home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5431 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Packing numbers ?????
  5. Date: Sat, 10 Feb 96 00:10:32 GMT
  6. Organization: none
  7. Message-ID: <823911032snz@genesis.demon.co.uk>
  8. References: <4fcudb$gnm@enterprise.america.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4fcudb$gnm@enterprise.america.com>
  15.            ngreen@enterprise.america.com "Nils Green" writes:
  16.  
  17. >I need to be able to pack a 6 digit number in a 4 digit number.  The 
  18. >numbers are julian dates, and we need the ability of storing them as
  19. >4 digit numbers.  Are there any algorithms, preferably not too complex, 
  20. >that can accomplish this?
  21.  
  22. Lets say we pack a year into 366 days. 4 digits gives you 10000 values hence
  23. 10000/366 i.e. just over 27 years. If that is adequate then the problem
  24. is easy enough. If not then you will need more than 4 digits.
  25.  
  26. >Please reply via e-mail, since I infrequently browse throught this group.
  27.  
  28. Wouldn't it be a good idea to review that policy while you have a question
  29. outstanding in the newsgroup, even if you only follow the one particular
  30. thread? Answers in the newsgroup can generate further discussion which
  31. may be of use to you.
  32.  
  33. -- 
  34. -----------------------------------------
  35. Lawrence Kirby | fred@genesis.demon.co.uk
  36. Wilts, England | 70734.126@compuserve.com
  37. -----------------------------------------
  38.